package com.okex.api.client.impl;

import static com.okex.api.client.impl.BinanceApiServiceGenerator.createService;
import static com.okex.api.client.impl.BinanceApiServiceGenerator.executeSync;

import com.okex.api.client.BinanceApiRestClient;
import com.okex.api.client.domain.market.OkexTicker;

/**
 * Implementation of Binance's REST API using Retrofit with synchronous/blocking
 * method calls.
 */
public class OkexApiRestClientImpl implements BinanceApiRestClient {

	private final BinanceApiService binanceApiService;

	public OkexApiRestClientImpl(String apiKey, String secret) {
		binanceApiService = createService(BinanceApiService.class, apiKey, secret);
	}


	  @Override
	  public OkexTicker getTicker(String symbol) {
	    return executeSync(binanceApiService.getTicker(symbol));
	  }
}
